package model

import (
	"github.com/gogf/gf/v2/util/gmeta"
)

type RechargeRecordIdReq struct {
	Id string `json:"id"  dc:"充值记录表id"    v:"required#充值记录id必填"`
}

type RechargeRecordInfo struct {
	RechargeMoney float64 `json:"rechargeMoney"  dc:"充值金额"`
	UserId        string  `json:"userId"  dc:"用户id"`
	GiveMoney     float64 `json:"giveMoney" dc:"赠送金额"`
	CompanyId     int64   `json:"companyId"  dc:"公司id" `
	GiveType      int     `json:"giveType" dc:"赠送类型 1 充值赠送 2 优惠券赠送" `
	GiveUser      int64   `json:"giveUser" dc:"操作人的id" `
	CouponId      string  `json:"couponId"  dc:"优惠券id" `
	RuleId        string  `json:"ruleId"  dc:"充值规则id" `
	NfcId         string  `json:"nfcId"  dc:"nfc卡Id" `
}

type RechargeRecordInfoAndId struct {
	Id string `json:"id"  dc:"充值记录表id"    v:"required#充值记录id必填"`
	*RechargeRecordInfo
}

type SearchRechargeRecordList struct {
	Id       string `json:"id"  dc:"充值记录表id"`
	GiveType int    `json:"giveType" dc:"充值/赠送类型 1 充值赠送 2 优惠券赠送 3. 商家直接赠送用户金额  4 实体卡充值赠送   5 商家直接赠送实体卡金额" v:"in:1,2,3,4,5#请按照赠送类型传值"`
	UserId   string `json:"userId"  dc:"用户id"`
	*Paging
}

type RechargeRecordDBRes struct {
	gmeta.Meta `orm:"table:lot_recharge_record"`
	RechargeRecordIdReq
	RechargeRecordInfo
}

type RechargeRecordListRes struct {
	gmeta.Meta `orm:"table:lot_recharge_record"`
	*RechargeRecordInfo
	Id               string               `json:"id"  dc:"充值记录表id"    v:"required#充值记录id必填"`
	CreatedAt        string               `json:"createdAt"  dc:"创建时间" `
	CouponInfo       *CouponInfoDBRes     `json:"couponInfo" dc:"优惠券详情" orm:"with:id=coupon_id"`
	CompanyInfo      *CompanyIdAndInfoRes `json:"companyInfo" dc:"公司详情" orm:"with:id=company_id"`
	RechargeRuleInfo *RechargeRuleDbRes   `json:"rechargeRuleInfo" dc:"充值规则信息" orm:"with:id=rule_id"`
}

type RechargeRecordListPageRes struct {
	List []*RechargeRecordListRes `json:"list" dc:"充值记录列表"`
	*PutPage
}
